package cn.edu.scau.cmi.xuandingcong.singleton;

import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class SingletonDomain {
	@FXML
	private TextField tf;
	@FXML
	private TextArea ta ;
	
	static Chairman chairman ;
	
	public void singletonDomain() {
		if( chairman.getInstance(tf.getText().trim()).getName().equals(tf.getText().trim()) ) {
			
			ta.appendText(tf.getText().trim());
		}

		else {
			ta.clear();
			ta.appendText("只能有一位元帅或者元帅已存在！");
		}
		
	}
}
